package com.hakim.wfb.biz;

import com.hakim.wfb.bean.User;
import com.hakim.wfb.dao.UserDao;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * Created by Administrator on 2017/7/2.
 */
@Service("userBiz")
public class UserBiz {

    @Autowired
    private UserDao userDao;

    public User getUser(String id) {
        return userDao.getById(id);
    }

    public User getUser(User t) {
        return userDao.get(t);
    }

    public List<User> getUsersByUserOrg(String userOrg) {
        return userDao.getUsersByUserOrg(userOrg);
    }

    public User getUserByUserOrg(String userOrg) {
        return userDao.getUserByUserOrg(userOrg);
    }

    /**
     * @param userOrg
     * @return
     */
    public int countByUserOrgActivated(String userOrg) {
        return userDao.countByUserOrgActivated(userOrg);
    }

    public User getUserByOrg(String userOrg) {
        return userDao.getUserByOrg(userOrg);
    }

    public List<User> getDirectUsers(String parentId) {
        return userDao.getDirectUsers(parentId);
    }

    public int countDirectActivated(String parentId) {
        return userDao.countDirectActivated(parentId);
    }

    public void Update(User user) {
        userDao.update(user);
    }

    public User getUserByUserCode(String userCode) {
        return userDao.getUserByUserCode(userCode);
    }

    /**
     * @param parentId
     * @return
     */
    public List<User> getDirectActivatedUsers(String parentId) {
        return userDao.getDirectActivatedUsers(parentId);
    }
}
